/*
* jlb
*/
package com.jlb.news.entity;

/**
 * 新闻公告 的实体类的状态
 * 状态：草稿 Draft，已发布  released，已删除 Delete
 *
 * @author jlb
 */
public enum NewsState implements java.io.Serializable {
    Draft("草稿"),
    Released("已发布"),
    Delete("已删除"),;

    public String val;

    NewsState(String val) {
        this.val = val;
    }

    /**
     * 根据状态名称查询状态
     *
     * @param stateName
     * @return
     */
    public static NewsState getEnum(String stateName) {
        for (NewsState newsState : NewsState.values()) {
            if (newsState.name().equalsIgnoreCase(stateName)) {
                return newsState;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return this.name();
    }

}
